home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / netprn.zip / NETPRNQU.DOC < prev    next >
Text File  |  1992-11-12  |  5KB  |  116 lines

  1. NETPRNQU.PAS - unit NetPrnQue
  2. -----------------------------
  3. Richard S. Sadowsky
  4. 10/2/92
  5.  
  6. Advanced NetWare versions 2.2 and higher have sophisticated print
  7. queueing capabilities. A local LPT port can be attached to a print
  8. queue and output written to that port will be routed directly to the
  9. print queue.
  10.  
  11. Unfortunately, the documentation Novell provides on the printer and
  12. job queueing API does not explain how to communicate directly with
  13. these print queues. The printer API discusses how to start, end, or
  14. cancel a capture, and how to set some print job flags. The job
  15. queueing API covers how to add, delete, and change a job in a general
  16. queue, but not specifically a print queue. One of the fields of the
  17. JobEntryType record that makes up a general queue entry is called the
  18. ClientRecord, which is a 152 byte buffer. The format of this record
  19. must be agreed upon by the job submitter and the job server that
  20. processes it. The bad news is that Novell does not appear to provide
  21. any documentation on the format of the ClientRecord when used with
  22. print queues.
  23.  
  24. As a result, we had to reverse engineer the ClientRecord in order to
  25. develop routines to aid in the manipulation of print queues. The
  26. routines in NETPRNQU build on top of the NETBIND and NETQUE bonus
  27. units. NETBIND, NETQUE, and NETPRNQU are all compatible with Turbo
  28. Pascal 5 or greater for DOS, BP 7.0 for protected mode DOS, and all
  29. versions of Turbo Pascal For Windows.
  30.  
  31. See the sample program EXPRNQUE for an example of these routines in
  32. action.
  33.  
  34. Procedures and Functions
  35. -----------------------------
  36. Declaration
  37.   function AddFileToPrintQueue(QueueID : LongInt;
  38.                                var JobEntry : JobEntryType;
  39.                                FName : String) : Byte;
  40. Purpose
  41.   Add a file to the specified print queue.
  42. Description
  43.   QueueID specifies the print queue where the job is added. It is
  44.   usually obtained by calling GetPrinterQueue.
  45.  
  46.   JobEntry must be properly initialized before the call. The following
  47.   fields are used:
  48.      TargetServerID   - use -1 to indicate "any server"
  49.      TargetExecTime   - fill with $FF to indicate "first opportunity"
  50.      JobControlFlags  - see the jcfXXX constants in NETQUE.PAS
  51.      NextJobDesc      - Asciiz string text description of print job.
  52.  
  53.   This call copies the contents of the file FName into the print
  54.   queue.
  55.  
  56.   AddFileToPrintQueue returns 0 if it is successful, otherwise a DOS
  57.   or NetWare error code.
  58.  
  59.  
  60. Declaration
  61.   function GetPrinterQueue(LPTDevice : Byte;
  62.                            var printQueueID : LongInt) : Byte;
  63. Purpose
  64.   Obtain the print queue assigned to a local LPT port.
  65. Description
  66.   Undocumented NetWare function to obtain the print queue assigned to
  67.   a specific local LPT port (0=LPT1, 1=LP2, 2=LPT3). Returns 0 if
  68.   successful. Note, however, that printQueueID is set to 0 if no queue
  69.   is attached to a particular printer port.
  70.  
  71.  
  72. Declaration
  73.   procedure MakeClientRecord(pTabSize : Byte;
  74.                              pNumCopies : Word;
  75.                              pFlags : Byte;
  76.                              pLinesPerPage : Word;
  77.                              pColsPerPage : Word;
  78.                              pBannerName : Str20;
  79.                              pUserName : String;
  80.                              var ClientArea : ClientRecordArea);
  81. Purpose
  82.   Initialize a ClientRecordArea variable.
  83. Description
  84.   Given some printer parameters, this routine initializes the
  85.   ClientRecordArea of the JobEntryType. The information needed to
  86.   write this function appears to be undocumented. This information was
  87.   obtained by reverse engineering print jobs created by NetWare. The
  88.   interpretation of some parameters is uncertain, as indicated in the
  89.   following.
  90.  
  91.   pTabSize must be between 1..12.
  92.  
  93.   pNumCopies must be 1 or more.
  94.  
  95.   pFlags can be any combination of:
  96.     pqPrintBanner    = $80; print banner
  97.     pqText           = $40; enables tab expansion
  98.     pqNotify         = $10; notifies the submitting workstation when done
  99.     pqFormFeed       = $08; Suppress form feed after form
  100.  
  101.   pLinesPerPage (not sure how this is used, pass zero here for
  102.   default).
  103.  
  104.   pColsPerPage  (not sure how this is used, pass zero here for
  105.   default).
  106.  
  107.   pBannerName is the name to appear in the banner. Only has meaning if
  108.   the pqPrintBanner flag is set in pFlags.
  109.  
  110.   pUserName is the user name to appear in the banner. Only has meaning
  111.   if the pqPrintBanner flag is set in pFlags.
  112.  
  113.   ClientArea will be formatted correctly for a call to
  114.   CreateQueueJobAndFile (or our higher level replacement,
  115.   AddFileToPrintQueue).
  116.